<?php
/**
 * 
 * @author Iain Edminster
 */
class Bliss_DataReport_Form_Alter extends Zend_Form_SubForm
{
	/**
	 * Class constructor
	 *
	 * @param Bliss_DataReport $report
	 */
	public function  __construct(Bliss_DataReport $report)
	{
		parent::__construct();

		$report->getResults();
		$this->setAttrib('class', 'report-alter');

		$columns = $report->getColumns();
		foreach($columns as $key => $column) {
			if(isset($column['permanent']) && $column['permanent'] == true) continue;
			
			$this->addElement(new Zend_Form_Element_Checkbox($key, array(
				'checked' => isset($column['visible']) && $column['visible'] == false ? false : true,
				'label' => $column['label']
			)));
		}

		$this->addElement(new Zend_Form_Element_Submit('submit_alter', 'Update Report'));
	}
}
?>
